<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Plupload: Test</title>

<!-- qunit -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-git.css" type="text/css" />
<script src="http://code.jquery.com/qunit/qunit-git.js"></script>

<!-- testrunner -->
<script src="../js/reporter.js"></script>
<script src="../scriptloader.js"></script>

<script type="text/javascript">

QUnit.config.reorder = false;

o.Env.swf_url = "../../js/flash/Moxie.swf";
o.Env.xap_url = "../../js/silverlight/Moxie.xap";

module("Plupload", {
	setup: function() {
	},

	teardown: function() {
	}
});

test("xmlEncode()", function() {
	expect(1);

	equal(plupload.xmlEncode("<tag>'string1'" + '&"string2"'), '&lt;tag&gt;&#39;string1&#39;&amp;&quot;string2&quot;', "<>&'\" symbols encode properly");
});


test("predictRuntime()", function() {
	var config = {
		runtimes : 'html4,silverlight,flash,html5',
		browse_button : 'pickfiles', // you can pass in id...
		container: $('container'), // ... or DOM Element itself
		multi_selection: true,
		max_file_size : '10mb',
		required_features: true,
		url : 'upload.php',
		flash_swf_url : '../js/Moxie.swf',
		silverlight_xap_url : '../js/Moxie.xap',
		filters : [
			{title : "Image files", extensions : "jpg,gif,png"},
			{title : "Zip files", extensions : "zip"}
		]
	};

	equal(plupload.predictRuntime(config), 'silverlight', "Successfully handled typical Plupload config.");

	config.runtimes = 'html4,flash,silverlight,html5';
	equal(plupload.predictRuntime(config), 'flash', "Flash can access binary too.");

	config.drop_element = 'container';
	delete config.required_features;

	equal(plupload.predictRuntime(config), 'html4', "Without options considered as required, html4 should be ok.");
});

</script>
</head>
<body>
	<h1 id="qunit-header">Plupload Test Suite</h1>
	<h2 id="qunit-banner"></h2>
	<h2 id="qunit-userAgent"></h2>
	<ol id="qunit-tests">
	</ol>
    <div id="qunit-fixture" style="position: relative; top: 0 !important; left: 0 !important; width: 100%; height: 9px;"></div>
</body>
</html>